package com.navi.loaddata.core.gpEntity;

import com.alibaba.fastjson.annotation.JSONField;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.Objects;

@Entity
@Table(name = "wpp_sht_ope_conf_ext", schema = "sor", catalog = "qmstst")
@IdClass(WppShtOpeConfExtPK.class)
public class WppShtOpeConfExt {
    private String opeId;
    private String targetColumn;
    private String sourceColumn;
    private String eventName;
    private String columnDesc;
    private String remark;
    private String evtUser;
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Timestamp evtTimestamp;
    private String valigFlg;

    @Id
    @Column(name = "ope_id")
    public String getOpeId() {
        return opeId;
    }

    public void setOpeId(String opeId) {
        this.opeId = opeId;
    }

    @Id
    @Column(name = "target_column")
    public String getTargetColumn() {
        return targetColumn;
    }

    public void setTargetColumn(String targetColumn) {
        this.targetColumn = targetColumn;
    }

    @Basic
    @Column(name = "event_name")
    public String getEventName() {
        return eventName;
    }

    public void setEventName(String eventName) {
        this.eventName = eventName;
    }

    @Basic
    @Column(name = "source_column")
    public String getSourceColumn() {
        return sourceColumn;
    }

    public void setSourceColumn(String sourceColumn) {
        this.sourceColumn = sourceColumn;
    }

    @Basic
    @Column(name = "column_desc")
    public String getColumnDesc() {
        return columnDesc;
    }

    public void setColumnDesc(String columnDesc) {
        this.columnDesc = columnDesc;
    }

    @Basic
    @Column(name = "remark")
    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    @Basic
    @Column(name = "evt_user")
    public String getEvtUser() {
        return evtUser;
    }

    public void setEvtUser(String evtUser) {
        this.evtUser = evtUser;
    }

    @Basic
    @Column(name = "evt_timestamp")
    public Timestamp getEvtTimestamp() {
        return evtTimestamp;
    }

    public void setEvtTimestamp(Timestamp evtTimestamp) {
        this.evtTimestamp = evtTimestamp;
    }

    @Id
    @Column(name = "valig_flg")
    public String getValigFlg() {
        return valigFlg;
    }

    public void setValigFlg(String valigFlg) {
        this.valigFlg = valigFlg;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        WppShtOpeConfExt that = (WppShtOpeConfExt) o;
        return Objects.equals(opeId, that.opeId) &&
                Objects.equals(targetColumn, that.targetColumn) &&
                Objects.equals(sourceColumn, that.sourceColumn) &&
                Objects.equals(columnDesc, that.columnDesc) &&
                Objects.equals(remark, that.remark) &&
                Objects.equals(evtUser, that.evtUser) &&
                Objects.equals(eventName, that.eventName) &&
                Objects.equals(evtTimestamp, that.evtTimestamp) &&
                Objects.equals(valigFlg, that.valigFlg);
    }

    @Override
    public int hashCode() {

        return Objects.hash(opeId, targetColumn, sourceColumn, columnDesc, remark, evtUser, evtTimestamp, valigFlg, eventName);
    }
}
